<!-- page heading start-->
<div class="page-heading">
	<ul class="breadcrumb">
		<li><a href="#"> 首页 </a></li>
		<li><a href="javascript:void(0);"> 导航管理 </a></li>
		<li class="active"> 导航列表</li>
	</ul>
</div>
<!-- page heading end-->
<div class="row">
	<div class="col-lg-12">
	 <section class="panel">
		<header class="panel-heading"> 
           		<span ng-if="navigation.id != null" > 编辑导航 </span>
            	<span ng-if="navigation.id == null" > 添加导航 </span>
         </header>
		<div class="panel-body">
			<form class="form-horizontal" id="navigationForm" name="myForm" enctype="multipart/form-data">
				<div class="form-group" ng-class="{'has-error':myForm.naName.$dirty && myForm.naName.$invalid}">
					<label class="col-sm-2 control-label">导航名称</label>
					 <div class="col-lg-10">
						<input type="text" ng-hide="true" ng-model="navigation.id" name="navigation.id">
						<input type="text" ng-model="navigation.na_name" name="naName" class="form-control" ng-required="true" ng-maxlength="32" ng-minlength="2" placeholder="导航名称">
						<div ng-show="myForm.naName.$dirty && myForm.naName.$error.maxlength" class="alert alert-danger help-block">
							不能超过32个字符
						</div>
						<div ng-show="myForm.naName.$dirty && myForm.naName.$error.minlength" class="alert alert-danger help-block">
							至少输入2个字符
						</div>
					</div>
				</div>
                    
                <div class="form-group">
                    <label for="inputTypeValue" class="col-sm-2 control-label">导航分类</label>
                    <div class="col-lg-10">
						<select ng-model="navigation.navigation_category_id" name="navigation_category_id" class="form-control" ng-required="true"
							ng-options="category.id as category.nc_name for category in categoryList">
							<option value="">请选择</option>
						</select>
                    </div>
                </div>

				<div class="form-group" ng-class="{'has-error':myForm.urlVal.$dirty && myForm.urlVal.$invalid}">
					<label class="col-sm-2 control-label">导航地址</label>
					<!-- <div class="col-sm-2" common-dict data="'url_type'">
						<select class="form-control" ng-model="urlType">
							<option ng-repeat="dict in dictList" value="{{dict.d_key}}">{{dict.d_value}}</option>
						</select>
					</div> -->
					 <div class="col-lg-8">
						<input type="text" class="form-control" ng-required="true" ng-maxlength="128" ng-model="navigation.na_url" name="urlVal">
						<div ng-show="myForm.urlVal.$dirty && myForm.urlVal.$error.maxlength" class="alert alert-danger help-block">
							不能超过128个字符
						</div>
					</div>
					<div ng-hide="true" ng-model="navigation.na_url"></div>
				</div>
				
				<div class="form-group">
				    <label class="col-lg-2 col-sm-2 control-label">图片上传</label>
				    <div class="col-lg-10">
				        <div class="htmleaf-container">
				            <div class="kv-main">
				                <input id="file" class="file" type="file">
							</div>
				        </div>
				    </div>
				</div>


				<div class="form-group" ng-class="{'has-error':myForm.naStatus.$dirty && myForm.naStatus.$invalid}">
					<label class="col-sm-2 control-label">是否启用</label>
					<div class="col-sm-4">
						<label class="radio-inline" ng-init="navigation.na_status = 1">
							<input type="radio" ng-model="navigation.na_status" ng-checked="1" name="naStatus" value="1"/>是
						</label>
						<label class="radio-inline">
							<input type="radio" ng-model="navigation.na_status" name="naStatus" value="0"/>否
						</label>
					</div>
				</div>

				<div class="form-group" ng-class="{'has-error':myForm.naSort.$dirty && myForm.naSort.$invalid}">
					<label class="col-sm-2 control-label">导航排序</label>
					 <div class="col-lg-10">
						<input type="number" ng-model="navigation.na_sort" name="naSort" class="form-control" ng-required="true" ng-maxlength="5" ng-minlength="1" placeholder="导航排序">
						<div ng-show="myForm.naSort.$dirty && myForm.naSort.$error.maxlength" class="alert alert-danger help-block">
							不能超过5个字符
						</div>
						<div ng-show="myForm.naSort.$dirty && myForm.naSort.$error.minlength" class="alert alert-danger help-block">
							至少输入1个字符
						</div>
					</div>
				</div>

				 <div class="form-group">
					<div class="col-sm-offset-2 col-sm-9">
						<button class="btn btn-danger" ng-disabled="myForm.$invalid" ng-click="navigation.id !=null ?update():input()">保存</button>
						<button class="btn btn-default" ng-click="back()">取消</button>
					</div>
				</div>
			</form>
		</div>
		 </section>
	</div>
</div>
